package com.dy.video.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.comments.Comments;
import entity.vo.CommentsVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author DELL
* @description 针对表【comments】的数据库操作Mapper
* @createDate 2024-11-27 09:01:45
* @Entity video.domain.Comments
*/
public interface CommentsMapper extends BaseMapper<Comments> {

    @Select("select c.*,u.name uname,u.image img from comments c left join user u on c.uid=u.id where c.vid=#{id} order by c.id desc")
    List<CommentsVo> commentAll(Integer id);

    @Select("select count(*) from comments where vid=#{id}")
    int tongji(Integer id);
}




